from django.http import HttpResponse
from django.shortcuts import render
from mydata.models import Mydata
# Create your views here.


def index(request):
    datas = Mydata.objects.all()
    return render(request, 'index.html',{'datas':datas})
# def index(request):  
#     if request.method == 'POST':  
#         form = DateFilterForm(request.POST)  
#         if form.is_valid():  
#             selected_date = form.cleaned_data['inspection_date']  
#             if selected_date:  
#                 datas = Mydata.objects.filter(inspection_date=selected_date)  
#             else:  
#                 datas = Mydata.objects.all()  
#     else:  
#         form = DateFilterForm()  
#         datas = Mydata.objects.all()  
  
#     return render(request, 'index.html', {'form': form, 'datas': datas})